package com.py.chat.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;



public class PropertiesUtil {

	private static Properties properties;
	
	static{
		properties = new Properties();
		InputStream in = PropertiesUtil.class.getClassLoader().getResourceAsStream("jdbc.properties");
		try {
			properties.load(in);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static String getValue(String key){
		
		String value = properties.getProperty(key.trim());
		if(value == null){
			return null;
		}
		return value.trim();
	}
	
	public static void main(String[] args) {
		
		System.err.println(getValue("username"));
	}
	
}
